-
Notifications
You must be signed in to change notification settings - Fork 0
[Ci] 자동 ERD 생성 워크플로 구현 #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
""" Walkthrough새로운 GitHub Actions 워크플로우가 추가되어, Pull Request 발생 시 Flyway 마이그레이션을 적용한 MySQL 스키마를 DBML로 변환하고 ERD 이미지를 생성한 뒤 GitHub Pages에 배포합니다. 또한, PR에 ERD 링크를 포함한 코멘트를 자동으로 남깁니다. Changes
Sequence Diagram(s)sequenceDiagram
participant PR as Pull Request
participant Actions as GitHub Actions Workflow
participant MySQL as MySQL (서비스)
participant Flyway as Flyway CLI
participant Node as Node.js 환경
participant DBML as dbml-cli
participant Pages as GitHub Pages
participant Comment as PR Comment
PR->>Actions: PR 생성/업데이트 트리거
Actions->>MySQL: MySQL 서비스 시작
Actions->>Flyway: 마이그레이션 적용
Flyway->>MySQL: 스키마 변경
Actions->>MySQL: 스키마 덤프 (SQL)
Actions->>Node: Node.js 및 dbml-cli 설치
Actions->>DBML: SQL→DBML 변환
Actions->>DBML: DBML→ERD(SVG) 변환
Actions->>Pages: ERD 및 HTML 배포
Actions->>Comment: PR에 ERD 링크 코멘트
Possibly related issues
Suggested labels
Suggested reviewers
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (2)
.github/workflows/automatic-erd.yml (2)
83-89: PR 간 결과물이 덮어쓰여 과거 PR 링크가 깨질 수 있습니다.
force_orphan: true로 매번gh-pages전체를 갱신하면 마지막 실행 결과만 보존됩니다. PR 코멘트가 가리키는 ERD가 이후 실행으로 덮여쓰여 내용이 달라질 수 있으므로, PR 번호별 하위 디렉터리로 퍼블리시하는 방식을 권장합니다.- publish_dir: ./erd + publish_dir: ./erd + destination_dir: pr-${{ github.event.pull_request.number }}코멘트 URL도 동일하게 수정해야 합니다.
20-30: 호스트 포트 고정 바인딩은 충돌 위험이 있으므로 불필요합니다.
서비스 컨테이너는 네트워크 브리지로 연결되어 있으며, 호스트(액션 러너)에서127.0.0.1:3306으로 접속하기 위해 굳이 포트를 노출할 필요가 없습니다. 포트 매핑을 제거하면 다른 워크플로(또는 서비스)와의 충돌 가능성을 줄일 수 있습니다.- ports: - - 3306:3306
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/automatic-erd.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
📄 Terraform Plan Summary🛡️ Common InfrastructureStatus: ✅ No Changes 🛠️ Development EnvironmentStatus: ✅ No Changes 📋 Full Results: View in Actions |
|
📌 최신 ERD가 자동 생성되었습니다. 👉 ERD 보러가기 |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
♻️ Duplicate comments (2)
.github/workflows/automatic-erd.yml (2)
57-61:mysqldump실행 전mysql-client설치가 여전히 누락되었습니다
ubuntu-latest러너에는mysqldump바이너리가 포함돼 있지 않아 이 단계에서 즉시 실패합니다. 지난 코멘트와 동일한 이슈이므로 반영해 주세요.- name: Dump database schema - run: | - mkdir -p erd - mysqldump -h 127.0.0.1 -u ${{ secrets.TEST_DB_USER }} -p${{ secrets.TEST_DB_PASSWORD }} --no-data --skip-comments testdb > erd/schema.sql + run: | + sudo apt-get update -y + sudo apt-get install -y mysql-client + mkdir -p erd + mysqldump -h 127.0.0.1 \ + -u ${{ secrets.TEST_DB_USER }} -p${{ secrets.TEST_DB_PASSWORD }} \ + --no-data --skip-comments testdb > erd/schema.sql
67-76: DBML 툴 체인 설치가 불완전합니다
sql2dbml패키지는 전역 설치 목록에 없고,@dbml/cli만으로는sql2dbml/dbml-renderer커맨드를 직접 제공하지 않습니다.npx가 즉석 설치를 시도하긴 하나, 캐시 없는 CI 환경에선 네트워크 이슈로 실패할 확률이 높습니다. 두 커맨드를 확실히 사용하려면 아래처럼 명시적으로 설치하세요.- - name: Install DBML Tools - run: npm install -g @dbml/cli @softwaretechnik/dbml-renderer + - name: Install DBML Tools + run: | + npm install -g @dbml/cli @softwaretechnik/dbml-renderer sql2dbml또는
dbml서브커맨드(dbml convert,dbml render)로 통일하는 방법도 있습니다.
🧹 Nitpick comments (1)
.github/workflows/automatic-erd.yml (1)
80-80: HTML wrapper 경로 하드코딩 주의
index.html내부<img src='erd.svg'>는 현재 디렉터리 기준 상대 경로입니다. 추후 디렉터리 구조를 변경하거나 다른 정적 호스팅으로 이전할 때 깨질 수 있으니, 필요하다면 절대 경로(/erd.svg) 나./erd.svg처럼 명시적 경로로 두는 방안을 고려해 주세요.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/automatic-erd.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test
leegwichan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/noti
늦은 Approve 죄송합니다;; 작업 확인했습니다!
|
🎉 This PR is included in version 1.4.0-develop.19 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |



✨ 개요
🧾 관련 이슈
🔍 참고 사항 (선택)
Summary by CodeRabbit